<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>文件服务</title>
</head>
<body>
  <a href="/share">文件目录</a>
  <form enctype="multipart/form-data" target="_top">
    <label for="up-file">上传文件</label>
    <input id="up-file" name="upFile" type="file" multiple/>
    <button type="button" onclick="uploadFile(this.parentElement)">上传</button>
  </form>
</body>
<script>
  function uploadFile(form) {
    let request = new XMLHttpRequest()
    request.open("post","/upload")
    request.send(new FormData(form))
    request.onload = () => {
      alert("上传成功")
    }
  }
</script>
</html>